/*
 * Building.h
 *
 *  Created on: 25.1.2013
 *      Author: Travis
 */

#pragma once

#include "../../Entity.h"
#include "../vegetation/Tree.h"
#include "../staticEntity.h"

#define START_MAX_SLAVES	5

class Building: public staticEntity
{
public:
	Building(glm::vec3 _Pos, float _r, std::string _Name, std::string _modelFName,
			ModelPool *_mPool, PathFinder *_pathfinder);
	virtual ~Building();

	virtual void draw(int shadertype);
	virtual void control(float t); // check move vector

	// move with entity to position
	virtual void goTo(glm::vec2 pos);

	// create info bar for building
	virtual void BuildUnitBar(std::string iconFName);

	virtual void updateAge();

	// add pointer to slave unit
	virtual void insertSlave(Entity* slave);

	// get space for slaves
	bool enoughSpace();

	int getMaxSlaves();
	int getCountOfSlaves();

	glm::vec2 getGPoint();

	Gadgets::Button* getAddWorkerButton();

	// set money to 0 after get
	int getMoney();
	// money + value
	void incMoney(int money);
protected:
	// building getting money when workers work
	int money;

	//	under construction ID model
	GLuint constructionMark;
	glm::vec2 gPoint;

	// pointers to entities under building command
	std::vector<Entity*> slaves;

	// maximum caunt of slaves
	int MaxSlaves;

	// radus around building
	int activityRadius;

	Gadgets::Button *addWorkerButton;
};
